package com.dapeng.cleardatabackend.model.vo.graphdetail;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author dapeng
 * @description 节点
 * @date 2024/12/22 22:35
 */
@Data
@ApiModel(description = "图谱节点")
public class Node implements Serializable {

    private static final long serialVersionUID = 431319699180079952L;

    /**
     * 节点id
     */
    @ApiModelProperty(value = "节点id")
    private Long id;

    /**
     * 节点名称
     */
    @ApiModelProperty(value = "节点名称")
    private String name;

    /**
     * 节点类型
     */
    @ApiModelProperty(value = "节点类型")
    private Integer category;


    /**
     * 节点文本
     */
    @ApiModelProperty(value = "节点文本")
    private String categoryText;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Node node = (Node) o;
        return Objects.equals(id, node.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
